﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.SessionState;
using Wedn.Core.Utility;

namespace Wedn.Web.UI.Admin.Handler
{
    /// <summary>
    /// logout 的摘要说明
    /// </summary>
    public class Logout : IHttpHandler, IRequiresSessionState
    {

        public void ProcessRequest(HttpContext context)
        {
            //清除session
            context.Session["CurrentUser"] = null;
            //context.Response.Redirect("~/admin/login.aspx");
            //清除cookie
            context.Response.Cookies[Config.SitePrefix + "URM"].Expires = DateTime.Now.AddDays(-1);
            context.Response.Redirect("~/admin/login.html");
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}